#!/bin/bash
set -e
export JAVA="$JAVA_HOME/bin/java"
JAVA_OPT="${JAVA_OPT} -Xms${JVM_XMS:-256m} -Xmx${JVM_XMX:-256m} -Xmn${JVM_XMN:-128m}"
JAVA_OPT="${JAVA_OPT} -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
JAVA_OPT="${JAVA_OPT} -Djava.security.egd=file:/dev/./urandom"

jarPath=`pwd`

# 托管给 supervisord 启动，可由 supervisorctl 控制
$JAVA ${JAVA_OPT} -jar $jarPath/autopai-work-time.jar ${ARGS:-dev} > /dev/null